package com.wanxi.login.entity;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;
import rx.annotations.Beta;

import java.util.Collection;

/**
 * @Author:Iny
 * @Data：2022/1/4 9:07
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("登陆校验")
@Builder
public class Login implements UserDetails {
    @ApiModelProperty("id")
    private int id;
    @ApiModelProperty("账号")
    private String username;
    @ApiModelProperty("密码")
    private String password;
    @ApiModelProperty("验证码")
    private String code;
    @ApiModelProperty(value = "角色")
    private int role;
    @ApiModelProperty(value = "信息id")
    private int roleId;
    @ApiModelProperty(value = "是否注销")
    private int isDelete;

    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public String getPassword() {
        return this.password;
    }

    @Override
    public String getUsername() {
        return this.username;
    }

    @Override
    public boolean isAccountNonExpired() {
        return true;
    }

    @Override
    public boolean isAccountNonLocked() {
        return true;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return true;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }


}
